<?php

/**
 * Contains a class to define an Email object to describe an email address.
 *
 * PHP Version 5
 *
 * @category BuyLocal
 * @package  BuyLocal
 * @author   Kevin Fodness <kevin.fodness@gmail.com>
 * @author   Mike Pennisi <mpennisi@andrew.cmu.edu>
 * @author   Aaron Ryden <aryden@gmail.com>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://code.google.com/p/buylocalopensourcerensselaer/
 */
 
/**
 * A class to define an Email object to describe an email address.
 *
 * @category BuyLocal
 * @package  BuyLocal
 * @author   Kevin Fodness <kevin.fodness@gmail.com>
 * @author   Mike Pennisi <mpennisi@andrew.cmu.edu>
 * @author   Aaron Ryden <aryden@gmail.com>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://code.google.com/p/buylocalopensourcerensselaer/
 */ 
class Email
{
    /**
     * The email address.
     *
     * @access public
     * @var string
     */
    public $address;
    
    /**
     * The description for the email address.
     *
     * @access public
     * @var string
     */
    public $description;
    
    /**
     * The constructor function.  Builds values using parameters.
     *
     * @param string $address     The email address.
     * @param string $description The description for the email address.
     *
     * @access public
     * @return null
     */
    public function __construct($address = null, $description = null)
    {
        $this->address     = $address;
        $this->description = $description;
    }

    /**
     * The clone function. Is called via the PHP5 'clone' keyword.
     * Since the 'clone' keyword automatically does a shallow copy of variables,
     * this code finishes the work and does a deep copy.
     *
     * @access public
     * @return null
     */
    public function __clone()
    {
        foreach ($this as $key => $val) {
            if (is_object($val) || is_array($val)) {
                $this->{$key} = unserialize(serialize($val));
            }
        }
    }
}

?>